home *** CD-ROM | disk | FTP | other *** search
- /*
- ** fossil.h -- declarations for fossil interface
- **
- ** public domain by Martin Maney
- **
- ** 29 Dec 89 added C++ wrapper
- ** 14 Dec 89 names revised
- ** 17 Jul 89 1st cut: minimal support for a few functions
- */
-
- #if !defined(__FOSSIL_H__)
- #define __FOSSIL_H__
-
- #if defined(__cplusplus)
- extern "C" {
- #endif
-
- /*
- ** symbols for supported baud rates & other parameters, use with
- ** port_setbaud(). All of these are compatible with the standard
- ** BIOS except B19200 and B38400, which use codes assigned to 110
- ** and 150 baud by the BIOS.
- */
-
- #define B300 (2 << 5)
- #define B600 (3 << 5)
- #define B1200 (4 << 5)
- #define B2400 (5 << 5)
- #define B4800 (6 << 5)
- #define B9600 (7 << 5)
- #define B19200 (0 << 5)
- #define B38400 (1 << 5)
-
- #define PARITY_NONE 0
- #define PARITY_EVEN (3<<3)
- #define PARITY_ODD (1<<3)
-
- #define STOPBITS_1 0
- #define STOPBITS_2 (1<<2)
-
- #define DATABITS_7 2
- #define DATABITS_8 3
-
- #define FC_NONE 0
- #define FC_XMT_XON 1
- #define FC_DTR 2
- #define FC_RCV_XON 8
-
-
- /*
- ** bit masks for port status (returned by portStatus(), etc)
- */
-
- #define PS_RDA (1 << 8)
- #define PS_OVRN (1 << 9)
- #define PS_THRE (1 << 13)
- #define PS_TSRE (1 << 14)
- #define PS_DCD (1 << 7)
-
-
- /*
- ** prototypes
- */
-
- void pascal port_setBaud(int port, int baud);
- int pascal port_open(int port);
- int pascal port_close(int port);
- void pascal port_flow(int port, int mode);
- void pascal port_dtr(int port, int enable);
- int pascal port_status(int port);
- int pascal port_read(int port, char *buf, int n);
- int pascal port_write(int port, const char *buf, int n);
-
- #if defined(__cplusplus)
- }
- #endif
-
- #endif /* __FOSSIL_H__ */
-